#!/bin/bash

set -eu

./gradlew :http-server:shadowJar

# Http-server is normally launched (if needed) by integration tests.
# On Travis, the http-server output from this launch process is not printed.
# To fix this, we launch an http-server explicitly and output is then 
# successfully printed.  This is important so we can see error output 
# if we have cases where tests somehow only fail on Travis (EG: http-500)
readonly HTTP_SERVER_JAR_PATH=$(find http-server/build/libs/ -type f -name "*.jar")
java -jar "$HTTP_SERVER_JAR_PATH" server ./http-server/configuration.yml &

